package com.project.controller;

import com.alibaba.fastjson.JSON;
import com.project.pojo.Apply;
import com.project.pojo.User;
import com.project.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;

@Controller()
@RequestMapping("/user")
public class UserController {


    @Autowired
    private UserService userService;

    /**
     * 添加 申请
     */
    @PostMapping("/addApply")
    @ResponseBody
    public String addApply(@RequestBody Apply apply){
        //调用方法
        userService.addApply(apply);
        //返回成功表示
        return "addSuccess";
    }
}
